using System.Collections;
using System.Collections.Generic;
using OrderSystem;
using PureMVC.Interfaces;
using PureMVC.Patterns;
using UnityEngine;

/// <summary>
/// 厨师命令类，负责处理菜品烹饪相关的业务逻辑
/// 继承自PureMVC的SimpleCommand，用于协调厨师代理完成烹饪任务
/// </summary>
public class CookCommend : SimpleCommand
{

    /// <summary>
    /// 执行命令，处理烹饪请求
    /// </summary>
    /// <param name="notification">包含订单信息的通知对象</param>
    public override void Execute(INotification notification)
    {
        if (notification.Type == "CookAdd")
        {
            CookProxy cookProxy = Facade.RetrieveProxy(CookProxy.NAME) as CookProxy; //厨师的代理
            Order order = notification.Body as Order;
            cookProxy.AssignOrderToCook(order);

        }
        else if (notification.Type == "CookRemove")
        {
            CookProxy cookProxy = Facade.RetrieveProxy(CookProxy.NAME) as CookProxy; //厨师的代理
            CookItem cookItem = notification.Body as CookItem;
            cookProxy.RemoveToCook(cookItem);
        }
    }
}
